package com.talkweb.test.dao;


import com.talkweb.test.entity.User;
import com.talkweb.test.entity.UserDto;
import org.springframework.stereotype.Repository;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @author huangqi
 */
@Repository
@SuppressWarnings("all")
public class OrderDaoImpl implements OrderDao {

   private final ConcurrentHashMap<String,UserDto> database = new ConcurrentHashMap<>(8);


    @Override
    public int insert(UserDto userDto) {
        database.put(userDto.getOrderId(),userDto);
        return 1;
    }

    @Override
    public UserDto getById(Integer id) {
        return   database.get(id);
    }
}